Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Ignore several import_of_legacy_library_into_null_safe#22326

Merged
scheglov merged 1 commit into
flutter-team-archive:masterfrom
scheglov:ignore-several-importLegacyIntoNullSafe
Nov 6, 2020
Merged

Ignore several import_of_legacy_library_into_null_safe#22326
scheglov merged 1 commit into
flutter-team-archive:masterfrom
scheglov:ignore-several-importLegacyIntoNullSafe

Conversation

@scheglov

@scheglov scheglov commented Nov 5, 2020

Copy link
Copy Markdown
Contributor

We want to enforce the migration order, and show when a legacy library is migrated into a Null Safe library.
See https://dart-review.googlesource.com/c/sdk/+/170441

There are several violations in Flutter.
I'd like to ignore them, and land the analyzer CL to prevent further regressions.

import 'package:test/bootstrap/browser.dart';
import 'package:test/test.dart';
import 'package:ui/ui.dart';
import 'package:test/bootstrap/browser.dart'; // ignore: import_of_legacy_library_into_null_safe

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: Do we need to change every occurrence of this import? I think we use it many golden tests, example: https://github.com/flutter/engine/blob/master/lib/web_ui/test/golden_tests/engine/canvas_blend_golden_test.dart

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only if the library that imports it is Null Safe, i.e. the Dart SDK is 2.12.0, and the library does not opt-out from null safety. The example you pointed at does opt-out, it has // @dart = 2.6, so sets the language version to 2.6, which is less than 2.12 where non-nullable feature it released, and less than 2.10 when this feature was experimentally-released.

@scheglov

scheglov commented Nov 6, 2020

Copy link
Copy Markdown
Contributor Author

@nturgut Do you have concerns with these changes, something I should fix?

@cbracken cbracken left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rslgtm

@scheglov scheglov merged commit cf37614 into flutter-team-archive:master Nov 6, 2020
@scheglov scheglov deleted the ignore-several-importLegacyIntoNullSafe branch November 6, 2020 17:55
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Development

Successfully merging this pull request may close these issues.

3 participants